API: Rename gdk_set_source_pixmap() to gdk_set_source_window()
authorBenjamin Otte <otte@redhat.com>
Fri, 27 Aug 2010 10:52:59 +0000 (12:52 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 26 Sep 2010 13:11:30 +0000 (15:11 +0200)
That's what it's used for now.

docs/reference/gdk/gdk3-sections.txt
gdk/gdk.symbols
gdk/gdkcairo.c
gdk/gdkcairo.h
gtk/gtkmenu.c
gtk/gtktoolitemgroup.c
tests/testgtk.c

index fa89fae98baf96a74464c66f6ba77916b07f81e1..46d94fc8f6641ec9db7f50ce87045729db6c5881 100644 (file)
@@ -643,7 +643,7 @@ gdk_window_create_similar_surface
 gdk_cairo_create
 gdk_cairo_set_source_color
 gdk_cairo_set_source_pixbuf
-gdk_cairo_set_source_pixmap
+gdk_cairo_set_source_window
 gdk_cairo_rectangle
 gdk_cairo_region
 gdk_cairo_reset_clip
index 989790467152aaa50493552217be770bc7130775..146ec0502e428cab01e49d47d5c5414cd4c0c798 100644 (file)
@@ -290,7 +290,7 @@ gdk_cairo_create
 gdk_cairo_reset_clip
 gdk_cairo_set_source_color
 gdk_cairo_set_source_pixbuf
-gdk_cairo_set_source_pixmap
+gdk_cairo_set_source_window
 gdk_cairo_rectangle
 gdk_cairo_region
 gdk_cairo_region_create_from_surface
index c5a55c5c157799bfabcc19c2d6d38b7f9f4ac268..7a7fc839cfc4057caa6b7dda55e9bcf533eea207 100644 (file)
@@ -266,28 +266,34 @@ gdk_cairo_set_source_pixbuf (cairo_t         *cr,
 }
 
 /**
- * gdk_cairo_set_source_pixmap:
+ * gdk_cairo_set_source_window:
  * @cr: a #Cairo context
- * @pixmap: a #GdkPixmap
- * @pixmap_x: X coordinate of location to place upper left corner of @pixmap
- * @pixmap_y: Y coordinate of location to place upper left corner of @pixmap
+ * @window: a #GdkWindow
+ * @x: X coordinate of location to place upper left corner of @window
+ * @y: Y coordinate of location to place upper left corner of @window
  * 
- * Sets the given pixmap as the source pattern for the Cairo context.
+ * Sets the given window as the source pattern for the Cairo context.
  * The pattern has an extend mode of %CAIRO_EXTEND_NONE and is aligned
- * so that the origin of @pixmap is @pixmap_x, @pixmap_y
+ * so that the origin of @window is @x, @y. The window contains all its
+ * subwindows when rendering.
+ * Note that the contents of @window are undefined outside of the
+ * visible part of @window, so use this function with care.
  *
  * Since: 2.10
  **/
 void
-gdk_cairo_set_source_pixmap (cairo_t   *cr,
-                            GdkPixmap *pixmap,
-                            double     pixmap_x,
-                            double     pixmap_y)
+gdk_cairo_set_source_window (cairo_t   *cr,
+                            GdkWindow *window,
+                            double     x,
+                            double     y)
 {
   cairo_surface_t *surface;
   
-  surface = _gdk_drawable_ref_cairo_surface (GDK_DRAWABLE (pixmap));
-  cairo_set_source_surface (cr, surface, pixmap_x, pixmap_y);
+  g_return_if_fail (cr != NULL);
+  g_return_if_fail (GDK_IS_WINDOW (window));
+
+  surface = _gdk_drawable_ref_cairo_surface (GDK_DRAWABLE (window));
+  cairo_set_source_surface (cr, surface, x, y);
   cairo_surface_destroy (surface);
 }
 
index c2a71e8a9214e09112723a544a112e5b2ce11c80..99afc064f8eaf58c9c2a0c8f2963ab0b27e04fc1 100644 (file)
@@ -40,10 +40,10 @@ void     gdk_cairo_set_source_pixbuf (cairo_t            *cr,
                                       const GdkPixbuf    *pixbuf,
                                       double              pixbuf_x,
                                       double              pixbuf_y);
-void     gdk_cairo_set_source_pixmap (cairo_t            *cr,
-                                      GdkPixmap          *pixmap,
-                                      double              pixmap_x,
-                                      double              pixmap_y);
+void     gdk_cairo_set_source_window (cairo_t            *cr,
+                                      GdkWindow          *window,
+                                      double              x,
+                                      double              y);
 
 void     gdk_cairo_rectangle         (cairo_t            *cr,
                                       const GdkRectangle *rectangle);
index 9b021e3957e590fb0fb1e5994502dfa1be6aced0..6cbbc2a9332aae7998048de8d022c05e4678206c 100644 (file)
@@ -1369,8 +1369,7 @@ gtk_menu_tearoff_bg_copy (GtkMenu *menu)
                                                    height);
 
       cr = cairo_create (surface);
-      /* Let's hope that function never notices we're not passing it a pixmap */
-      gdk_cairo_set_source_pixmap (cr,
+      gdk_cairo_set_source_window (cr,
                                    window,
                                    0, 0);
       cairo_paint (cr);
index 86cb7c395c5250a36b34a4bcb40175c1d89854dd..b099ebe3998906477ce56e8299e2cacffc817388 100644 (file)
@@ -2326,7 +2326,7 @@ _gtk_tool_item_group_paint (GtkToolItemGroup *group,
 
   gtk_widget_get_allocation (widget, &allocation);
 
-  gdk_cairo_set_source_pixmap (cr, gtk_widget_get_window (widget),
+  gdk_cairo_set_source_window (cr, gtk_widget_get_window (widget),
                                allocation.x,
                                allocation.y);
 
index c503568a99e4df04b3e05b449ecafe0317bb1acf..942e8421e527129a063c6b8c53c5b3c85d097b1a 100644 (file)
@@ -397,7 +397,7 @@ window_expose_event (GtkWidget *widget,
   gtk_widget_get_allocation (child, &allocation);
 
   /* the source data is the (composited) event box */
-  gdk_cairo_set_source_pixmap (cr, gtk_widget_get_window (child),
+  gdk_cairo_set_source_window (cr, gtk_widget_get_window (child),
                                allocation.x,
                                allocation.y);